package com.mdinic.blogovi.front.page.shared;

import java.util.List;

import org.apache.wicket.markup.html.panel.Panel;

import com.mdinic.blogovi.front.common.AbstractMorePage;
import com.mdinic.blogovi.front.page.BSession;
import com.mdinic.blogovi.front.page.blogpost.BlogPostPersonPanel;
import com.mdinic.blogovi.front.page.blogpost.BlogPostPersonPanel.Config;
import com.mdinic.blogovi.model.BlogPost;

/**
 * Class that represents blog post page.
 * 
 * @author mdinic
 */
public class BlogPostSharedPage extends AbstractMorePage<BlogPost> {

    private static final long serialVersionUID = 1L;

    /**
     * Constructor.
     */
    public BlogPostSharedPage() {
        super(20, true);
    }

    @Override
    protected List<BlogPost> getList(int firstResult, int maxResults) {
        return BlogPost.findSharedBlogPostsByPerson(BSession.get().getPerson(), firstResult, maxResults);
    }

    @Override
    protected Panel createPanel(List<BlogPost> list) {
        return new BlogPostPersonPanel(PANEL, list, new Config(false, false, false, false, false, false));
    }
}
